<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
[#include "../common/head.html"/]
[@head title="activityprizerecord.list.title"/]
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed page-quick-sidebar-over-content">
[#include "../common/top.html"/]
<!-- BEGIN CONTAINER -->
<div class="page-container">
	[#include "../common/left.html"/]
	[@menu menu="financial" submenu="activity-prize-record"/]
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div id="ajax-modal" class="modal fade bs-modal" tabindex="-1"></div>
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- Begin: life time stats -->
					<div class="portlet">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-list-ul"></i>[@spring.message code="activityprizerecord.list.caption"/]
							</div>
							<div class="actions">
								<div class="btn-group">
									<a class="btn default yellow-stripe" href="#" data-toggle="dropdown">
									<i class="fa fa-share"></i>
									<span class="hidden-480">批量操作</span>
									<i class="fa fa-angle-down"></i>
									</a>
									<ul class="dropdown-menu pull-right">
										<li>
											<a href="#">通过</a>
										</li>
										<li>
											<a href="#">拒绝</a>
										</li>
										<li>
											<a href="#">作废</a>
										</li>
									</ul>
								</div>
							</div>
						</div>
						<div class="portlet-body">
							<div class="table-container">
								<div class="table-actions-wrapper"></div>
								<table class="table table-striped table-bordered table-hover" id="datatable_activityprizerecords">
									<thead>
										<tr role="row" class="heading">
											<th style="text-align: center; min-width: 90px;">[@spring.message code="datatable.column.operation"/]</th>
											<th class="checker-wrapper"><input type="checkbox" class="group-checkable"></th>
											<th style="min-width: 120px">[@spring.message code="activityprizerecord.list.datatable.column.userName"/]</th>
											<th>[@spring.message code="activityprizerecord.list.datatable.column.billNo"/]</th>
											<th>[@spring.message code="activityprizerecord.list.datatable.column.amount"/]</th>
		                                    <th>[@spring.message code="activityprizerecord.list.datatable.column.prizeType"/]</th>
											<th>[@spring.message code="activityprizerecord.list.datatable.column.status"/]</th>
											<th>[@spring.message code="activityprizerecord.list.datatable.column.remark"/]</th>
											<th>[@spring.message code="datatable.column.createdBy"/]</th>
		                                    <th>[@spring.message code="datatable.column.createdDate"/]</th>
		                                    <th>[@spring.message code="datatable.column.lastModifiedBy"/]</th>
		                                    <th>[@spring.message code="datatable.column.lastModifiedDate"/]</th>
										</tr>
										<tr role="row" class="filter">
		                                	<td style="text-align: center;">
												<div class="margin-bottom-5">
													<button class="btn btn-sm yellow filter-submit margin-bottom"><i class="fa fa-search"></i> [@spring.message code="datatable.filter.search"/]</button>
												</div>
												<button class="btn btn-sm red filter-cancel"><i class="fa fa-times"></i> [@spring.message code="datatable.filter.reset"/]</button>
											</td>
											<td></td>
											<td>
												<div class="margin-bottom-5">
													<input type="text" class="form-control form-filter input-sm" name="userName" value="${RequestParameters["userName"]!}">
												</div>
												<div class="btn-group" data-toggle="buttons">
													<label class="btn btn-default radio active">
														<input name="userSearchType" value="SELF" checked="checked" type="radio" class="toggle form-filter">[@spring.message code="net.lanelife.casino.cms.web.controller.support.UserSearchFilter.FilterType.SELF"/]
													</label>
													<label class="btn btn-default radio">
														<input name="userSearchType" value="TEAM" type="radio" class="toggle form-filter">[@spring.message code="net.lanelife.casino.cms.web.controller.support.UserSearchFilter.FilterType.TEAM"/]
													</label>
												</div>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_billNo" value="${RequestParameters["billNo"]!}">
											</td>
											<td>
												<div class="margin-bottom-5">
													<input type="text" class="form-control form-filter input-sm" name="search_GTE_amount" placeholder="[@spring.message code="datatable.filter.from"/]"/>
												</div>
												<input type="text" class="form-control form-filter input-sm" name="search_LTE_amount" placeholder="[@spring.message code="datatable.filter.to"/]"/>
											</td>
											<td>
												<select name="search_EQ_prizeTypeCode" class="form-control form-filter input-sm">
													<option value="">[@spring.message code="datatable.filter.select"/]</option>
		                                            [#list prizeTypeList as item]
														<option value="${item.code}">${item.name}</option>
													[/#list]
												</select>
											</td>
											<td>
												<select name="search_EQ_status" class="form-control form-filter input-sm">
													<option value="">[@spring.message code="datatable.filter.select"/]</option>
		                                            [#list enums["net.lanelife.casino.caipiao.entity.ActivityPrizeRecord$Status"]?values as item]
													<option value="${item.name()}">[@spring.message code="net.lanelife.casino.caipiao.entity.ActivityPrizeRecord.Status."+item.name()/]</option>
													[/#list]
												</select>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_LIKE_remark">
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_createdBy">
											</td>
											<td>
												<div class="input-group date date-picker margin-bottom-5" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_GTE_createdDate" placeholder="[@spring.message code="datatable.filter.from"/]" value="${RequestParameters["beginCreateDate"]!.now?date+" 00:00:00"}"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
												<div class="input-group date date-picker" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_LTE_createdDate" placeholder="[@spring.message code="datatable.filter.to"/]" value="${RequestParameters["endCreateDate"]!.now?date+" 23:59:59"}"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_lastModifiedBy">
											</td>
		                                    <td>
												<div class="input-group date date-picker margin-bottom-5" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_GTE_lastModifiedDate" placeholder="[@spring.message code="datatable.filter.from"/]"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
												<div class="input-group date date-picker" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_LTE_lastModifiedDate" placeholder="[@spring.message code="datatable.filter.to"/]"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
											</td>
										</tr>
									</thead>
									<tbody>
									</tbody>
									<tfoot>
										<tr>
		                                	<td style="text-align: center; height: 25px;">[@spring.message code="datatable.footer.aggregate"/]</td>
		                                	<td></td>
											<td colspan="10" style="text-align: left; min-width: 900px">
												<div style="color: #c6c6c6; float: left">
													[@spring.message code="activityprizerecord.list.datatable.aggregate.pending"/]<label id="aggregate_amountPending" style="min-width: 120px;"></label>
												</div>
												<div style="color: #45b6af; float: left">
													[@spring.message code="activityprizerecord.list.datatable.aggregate.accepted"/]<label id="aggregate_amountAccepted" style="min-width: 120px;"></label>
												</div>
												<div style="color: #f3565d; float: left">
													[@spring.message code="activityprizerecord.list.datatable.aggregate.rejected"/]<label id="aggregate_amountRejected" style="min-width: 120px;"></label>
												</div>
												<div style="color: #dfba49; float: left">
													[@spring.message code="activityprizerecord.list.datatable.aggregate.cancelled"/]<label id="aggregate_amountCancelled" style="min-width: 120px;"></label>
												</div>
												<div style="float: left">
													[@spring.message code="activityprizerecord.list.datatable.aggregate.total"/]<label id="aggregate_total" style="min-width: 120px;"></label>
												</div>
											</td>
										</tr>
									</tfoot>
								</table>
							</div>
						</div>
					</div>
					<!-- End: life time stats -->
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->

[#include "../common/foot.html"/]

[#assign path="${ctx}/activity-prize-record"/]

<script type="text/javascript">

jQuery(document).ready(function() {   
	
    grid.init({
        src: $("#datatable_activityprizerecords"),
        fixedColumns: 2,
        onSuccess: function (data) {
        	var ap = parseFloat($('#aggregate_amountPending').html());
        	var aa = parseFloat($('#aggregate_amountAccepted').html());
        	var ar = parseFloat($('#aggregate_amountRejected').html());
        	var ac = parseFloat($('#aggregate_amountCancelled').html());
        	$('#aggregate_total').html((ap + ac + aa + ar).toFixed(2));
        },
        onError: function (data) { },
        dataTable: {
            "pageLength": 10,
            "ajax": {"url": "${path}"},
            "columnDefs": [{'orderable': false, 'targets': [0, 1]}],
            "columns": [
                {"data": "id", "render": function(data,type,full) {
                	return '<div class="btn-group">'+
							'	<a href="#" class="btn green btn-xs btn-operation" style="width:40px">' + '通过' + '</a>'+
							'	<a href="#" class="btn red btn-xs btn-operation" style="width:40px">' + '拒绝' + '</a>'+
							//'	<a href="#" class="btn yellow btn-xs btn-operation" style="width:40px">' + '作废' + '</a>'+
							'</div>';
				}},
				{"data": "id", "render": function(data,type,full) {
                	return '<input type="checkbox" name="id[]" value="'+data+'">';
                }},
                {"data": "userName"},
                {"data": "billNo"},
                {"data": "amount", "class": "right"},
                {"data": "prizeTypeName"},
                {"data": "status", "render": function(data,type,full) {
                	switch (data) {
					case 'PENDING':
						return '<span class="label label-sm label-default">' + message['net.lanelife.casino.caipiao.entity.ActivityPrizeRecord.Status.PENDING'] + '</span>';
					case 'ACCEPTED':
						return '<span class="label label-sm label-success">' + message['net.lanelife.casino.caipiao.entity.ActivityPrizeRecord.Status.ACCEPTED'] + '</span>';
					case 'REJECTED':
						return '<span class="label label-sm label-danger">' + message['net.lanelife.casino.caipiao.entity.ActivityPrizeRecord.Status.REJECTED'] + '</span>';
					case 'CANCELLED':
						return '<span class="label label-sm label-warning">' + message['net.lanelife.casino.caipiao.entity.ActivityPrizeRecord.Status.CANCELLED'] + '</span>';
					}
				}},
                {"data": "remark"},
                
                {"data": "createdBy"},
				{"data": "createdDate"},
				{"data": "lastModifiedBy"},
				{"data": "lastModifiedDate"}
            ],
            "order": [
                [9, "desc"]
            ]
        }
    });
});
</script>

</body>
<!-- END BODY -->
</html>